package com.supersoul.myself.dao;

import com.supersoul.myself.entity.Blog;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface BlogDao extends JpaRepository<Blog, String >, JpaSpecificationExecutor<Blog> {

    Page<Blog> findByPermissionStateAndPublishState(Integer permissionState, Integer publishState, Pageable pageable);

    Page<Blog> findByPermissionStateAndPublishStateAndCgId(Integer permissionState, Integer publishState, String cgId, Pageable pageable);

}
